package main

import (
	"fmt"
	"os"
)

func main() {
	for k, v := range os.Environ() {
		fmt.Printf("%d: %s\n", k, v)
	}

	key := "HOME"
	p := os.Getenv(key)
	fmt.Println(p)

	//会判断有没有
	env, ok := os.LookupEnv(key)
	if ok {
		fmt.Println("found:", env)
	} else {
		fmt.Println("not found")
	}
}
